﻿using System.Collections.Generic;
namespace Apq.DB.XSD
{
	public partial class DBMeta
	{
		public partial class DBTableDataTable
		{
			public DBTableRow FindByTableName(string SchemaName, string TableName)
			{
				DBTableRow dr = null;
				foreach (DBTableRow dr1 in Rows)
				{
					if (SchemaName.Equals(dr1.SchemaName, System.StringComparison.OrdinalIgnoreCase)
						&& TableName.Equals(dr1.TableName, System.StringComparison.OrdinalIgnoreCase)
					)
					{
						dr = dr1;
						break;
					}
				}
				return dr;
			}
		}

		partial class DBViewDataTable
		{
			public DBViewRow FindByTableName(string SchemaName, string TableName)
			{
				DBViewRow dr = null;
				foreach (DBViewRow dr1 in Rows)
				{
					if (SchemaName.Equals(dr1.SchemaName, System.StringComparison.OrdinalIgnoreCase)
						&& TableName.Equals(dr1.TableName, System.StringComparison.OrdinalIgnoreCase)
					)
					{
						dr = dr1;
						break;
					}
				}
				return dr;
			}
		}

		public partial class DBProcDataTable
		{
			public DBProcRow FindByProcName(string SchemaName, string ProcName)
			{
				DBProcRow dr = null;
				foreach (DBProcRow dr1 in Rows)
				{
					if (SchemaName.Equals(dr1.SchemaName, System.StringComparison.OrdinalIgnoreCase)
						&& ProcName.Equals(dr1.ProcName, System.StringComparison.OrdinalIgnoreCase)
					)
					{
						dr = dr1;
						break;
					}
				}
				return dr;
			}
		}

		public partial class DBTriggerDataTable
		{
			public DBTriggerRow FindByTriName(string SchemaName, string TriName)
			{
				DBTriggerRow dr = null;
				foreach (DBTriggerRow dr1 in Rows)
				{
					if (SchemaName.Equals(dr1.SchemaName, System.StringComparison.OrdinalIgnoreCase)
						&& TriName.Equals(dr1.TriName, System.StringComparison.OrdinalIgnoreCase)
					)
					{
						dr = dr1;
						break;
					}
				}
				return dr;
			}
		}
	}
}
